##Figure 1

library(foreign)
library(tidyverse)
library(ggplot2)
library(readstata13)
theme_set(theme_bw(16))
data<-read.dta13("Figure1Data.dta")
year<-data[,1]
partyvotes<-data[,2]
sess<-data[,3]
pairs<-data[,4]
Session<-as.factor(sess)
pdf(file="Figure1.pdf", family="Bookman")
data %>%
  ggplot(aes(year, partyvotes, group=Session))+
  scale_color_grey(start=.2, end=.4)+
  scale_x_continuous(limits=c(1955,2018), breaks=seq(1956,2018,by=4))+
  ylim(0, 100)+
  geom_line(aes(group=pairs),
            color="gray65",
            arrow=arrow(type="closed",
                        length=unit(0.09, "inches")))+
  geom_point(aes(shape=Session, color=Session))+
  theme(legend.position="bottom")+
  theme(axis.text.x=element_text(angle=90, vjust=.5))+
  xlab("Year")+
  ylab("Percent")+
  theme(panel.grid.minor=element_line(colour="gray90", size=.25),
        panel.grid.major=element_line(colour="gray90", size=.4))
dev.off()

